<?php 
//Identify the Unit Project Type based on its belong project type
switch ($project->type)
{
	case 'Dike-Levees':
		$unitProjectTypeArr = array(
			'Dike-Levees-Body' => Yii::t('project','Levees-Body'),
			'Dike-Embankment' => Yii::t('project','Embankment'),
		);
		break;
	case 'Dike-Connecting buildings':
		$unitProjectTypeArr = array(
			'Dike-Culverts' => Yii::t('project','Culverts'),
			'Dike-Sluice' => Yii::t('project','Sluice'),
			'Dike-Road-Bridge' => Yii::t('project','Road-Bridge'),
			'Dike-Road' => Yii::t('project','Road'),
		);
		break;
	case 'Dike-Management Facilities':
		$unitProjectTypeArr = array(
			'Dike-Management Facilities' => Yii::t('project','Management Facilities'),
		);
		break;
	case 'Diversion-Channel':
		$unitProjectTypeArr = array(
			'Diversion-Open-Channel' => Yii::t('project','Open-Channel'),
			'Diversion-Closed-Channel' => Yii::t('project','Closed-Channel'),
		);
		break;
	case 'Diversion-Buildings':
		$unitProjectTypeArr = array(
			'Diversion-Sluice' => Yii::t('project','Sluice'),
			'Diversion-Aqueduct' => Yii::t('project','Aqueduct'),
			'Diversion-Tunnel' => Yii::t('project','Tunnel'),
			'Diversion-Inverted-Siphon-Project' => Yii::t('project','Inverted-Siphon-Project'),
			'Diversion-Culverts' => Yii::t('project','Culverts'),
			'Diversion-Pumping-Station' => Yii::t('project','Pumping-Station'),
			'Diversion-Road-Bridge' => Yii::t('project','Road-Bridge'),
		);
		break;
	case 'Diversion-Lock':
		$unitProjectTypeArr = array(
			'Diversion-Lock' => Yii::t('project','Lock'),
		);
		break;
	case 'Diversion-Management Facilities':
		$unitProjectTypeArr = array(
			'Diversion-Management Facilities' => Yii::t('project','Management Facilities'),
		);
		break;
	default:
		$unitProjectTypeArr = array(
			'Undefined' => Yii::t('common','Undefined'),
		);;
}

?>

<?php $form=$this->beginWidget('bootstrap.widgets.TbActiveForm',array(
	'id'=>'unit-project-form',
	'enableAjaxValidation'=>false,
)); ?>

	<?php echo $form->errorSummary($model); ?>

	<?php echo $form->textFieldRow($model,'name',array('class'=>'span5','maxlength'=>48)); ?>
	
	<?php echo $form->labelEx($model,'type');?>
	<?php echo $form->dropDownList($model, 'type', $unitProjectTypeArr); ?>

	<?php echo $form->textAreaRow($model,'description',array('class'=>'span5','maxlength'=>255)); ?>
	
	<div class="form-actions">
		<?php $this->widget('bootstrap.widgets.TbButton', array(
				'buttonType'=>'link',
				'type'=>'link',
				'url'=>array('unitProject/status', 'id'=>$model->id),
				'label'=>Yii::t('common','Cancel'),
			)); ?>
		<?php $this->widget('bootstrap.widgets.TbButton', array(
			'buttonType'=>'submit',
			'type'=>'primary',
			'label'=>$model->isNewRecord ? Yii::t('common','Create') : Yii::t('common','Save and Next'),
		)); ?>
	</div>

<?php $this->endWidget(); ?>